//
//  NetWorkShare.m
//  ETong
//
//  Created by wanzhao on 15/10/28.
//  Copyright (c) 2015年 wanzhao. All rights reserved.
//

#import "NetWorkShare.h"
#import "SSKeychain.h"


@implementation NetWorkShare

+(NetWorkShare *)netWorkShareInstance
{
    static NetWorkShare *instance  = nil;
    static dispatch_once_t dispatch_onces;
    if(instance  == nil)
    {
        dispatch_once(&dispatch_onces, ^{
            
            instance = [[NetWorkShare alloc] init];
        });
    }
    return instance;
}

-(id)init
{
    self = [super init];
    {
        
    }
    return self;
}

#pragma mark -- 登录登出
/**登录*/
+ (void)loginOAWithUserName:(NSString *)userName pwd:(NSString *)pwd successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/user!login.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"name"] = userName;
    dictM[@"pwd"] = pwd;
    dictM[@"platform"] = @"2";
   [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
       successHandle(operation,responseObject);
   } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
       failureHandle(operation,error);
   }];
    
}

/**登出*/
+ (void)loginOutOAWithUserId:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/user!loginOut.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"id"] = userId;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

#pragma mark -- 手机考勤
/**考考勤服务站点*/
+ (void)getIpAddressWithUserId:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/checkInServerInterface_findIpAddress.action", SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userId"] = userId;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
}

#pragma mark -- 工作日程
// 查询日程
+ (void)queryScheduleWithUserName:(NSString *)userName pwd:(NSString *)pwd beginTime:(NSString *)beginTime endTime:(NSString *)endTime alertBeginTime:(NSString *)alertBeginTime alertEndTime:(NSString *)alertEndTime successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/internetInterface/schedule!query.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"name"] = userName;
    dictM[@"pwd"] = pwd;
    dictM[@"beginTime"] = beginTime;
    dictM[@"endTime"] = endTime;
    dictM[@"alertBeginTime"] = alertBeginTime;
    dictM[@"alertEndTime"] = alertEndTime;
    
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];
}

// 查询日程详细
+ (void)getByIDWithUserName:(NSString *)userName pwd:(NSString *)pwd scheduleID:(NSString *)scheduleID successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/internetInterface/schedule!getById.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"name"] = userName;
    dictM[@"pwd"] = pwd;
    dictM[@"id"] = scheduleID;
    dictM[@"platform"] = @"2";
    
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];
}

// 删除日程
+ (void)deleteByIDWithUserName:(NSString *)userName pwd:(NSString *)pwd scheduleID:(NSString *)scheduleID successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [NSString stringWithFormat:@"http://%@/OA_CBD/internetInterface/schedule!deleteById.action",SERVERIP];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"name"] = userName;
    dictM[@"pwd"] = pwd;
    dictM[@"id"] = scheduleID;
    
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
}

// 保存日程
+ (void)saveScheduleWithUserName:(NSString *)userName pwd:(NSString *)pwd scheduleID:(NSString *)scheduleID scheduleTitle:(NSString *)scheduleTitle startTime:(NSString *)startTime alertTime:(NSString *)alertTime alertFlag:(NSString *)alertFlag beforeLength:(NSString *)beforeLength beforeUnitFlag:(NSString *)beforeUnitFlag editFlag:(NSString *)editFlag successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [NSString stringWithFormat:@"http://%@/OA_CBD/internetInterface/schedule!save.action",SERVERIP];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"name"] = userName;
    dictM[@"pwd"] = pwd;
    dictM[@"id"] = scheduleID;
    dictM[@"title"] = scheduleTitle;
    dictM[@"startTime"] = startTime;
    dictM[@"alertTime"] = alertTime;
    dictM[@"alertFlag"] = alertFlag;
    dictM[@"beforeLength"] = beforeLength;
    dictM[@"beforeUnitFlag"] = beforeUnitFlag;
    dictM[@"editFlag"] = editFlag;
    
    
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
}


#pragma mark -- 任务管理
/**n获取任务的所有状态*/
+ (void)getTaskStatusWithName:(NSString *) name pwd:(NSString *)pwd SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/v2task_findTaskStatus.action",SERVERIP];
    
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"name"] = name;
    dictM[@"pwd"] = pwd;
    [manager GET:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
}

/**获取任务列表*/
+ (void)getTaskListWithParams:(NSDictionary *) params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/v2task_list.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
    
}


/**得到任务的详细信息*/
+ (void)getTaskDetailInforWithParams:(NSDictionary *) params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/v2task_findById.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];

}


/**接受或者拒绝任务*/
+ (void)acceptAndRefuseWithParams:(NSDictionary *) params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/v2task_accept.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
}

#pragma mark - 分配人审核
+ (void)assignerAuthorizedWithParams:(NSDictionary *) params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/v2task_agreeOrNotAgree.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
}

#pragma mark - 分配人查找待办审核
+ (void)assignerFetchScheduleWithParams:(NSDictionary *)params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/v2task_findTaskExtApply.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
}


/**提交进度*/
+ (void)saveProgressWithParams:(NSDictionary *)params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/v2task_saveProgress.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
    
}

/**延期*/
+ (void)applyForDelayWithParams:(NSDictionary *)params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/v2task_applyDelaySubmit.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
}

// 任务完成
+ (void)finishedTaskWithParams:(NSDictionary *)params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/v2task_executeTaskApplyFinish.action", SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
    
}


// 任务日志
+ (void)getTaskManagerLogWithParams:(NSDictionary *)params SuccessHandle:(successHandle) successHandle FailureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/v2task_queryLog.action", SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
    
}


/**获取个人信息*/
+ (void)getPersonalInfoWithUserId:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/user!getPersonalInfo.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userid"] = userId;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

/**
 修改个人信息
 dict参数：userId，mobile，telephone，mail
 */
+ (void)updatePersonalInfoWithUpdateDict:(NSDictionary *)dict successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/user!updataPersonalInfo.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    [manager POST:urlStr parameters:dict success:^(AFHTTPRequestOperation *operation, id responseObject) {
        
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
        failureHandle(operation,error);
    }];

}

/**设置头像*/
+ (void)updateHeaderImageWithUserId:(NSString *)userId imageData:(NSData *)imageData successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/user!uploadHeadImage.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userId"] = userId;
    dictM[@"imageData"] = imageData;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation, responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation, error);
    }];
   
}


/**重置密码*/
+ (void)resetPWDWithUserId:(NSString *)userId newPwd:(NSString *)newPwd oldPwd:(NSString *)oldPwd successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/user!resetPWD.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userid"] = userId;
    dictM[@"newpwd"] = newPwd;
    dictM[@"oldpwd"] = oldPwd;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];
}


/**版本更新*/
+ (void)getNewVersionWithCurrentVersion:(NSString *)curVersion successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/version!updateVersion.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"version"] = curVersion;
    dictM[@"platform"] = @"2";
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

/**问题答疑*/
+ (void)getQuestionListWithQuestionTitle:(NSString *)quetionTitle pageNO:(NSString *)pageNO pageSize:(NSString *)pageSize successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    if (M_ISSTRNULL(quetionTitle)) {
        quetionTitle = @"";
    }
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/problem!problemList.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"title"] = quetionTitle;
    dictM[@"pageNO"] = pageNO;
    dictM[@"pageSize"] = pageSize;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

/**答疑详情*/
+ (void)getQuestionDetailWithQuestionID:(NSString *)questionId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/problem!problemDetail.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"id"] = M_STOREVALUE(questionId);
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

/**意见反馈*/
+ (void)submitSuggestionWithUserId:(NSString *)userId suggestion:(NSString *)suggestion modelId:(NSString *)modelId modelName:(NSString *)modelName successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/opinion!addOpinion.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userid"] = userId;
    dictM[@"opinion"] = suggestion;
    dictM[@"modelId"] = modelId;
    dictM[@"modelName"] = modelName;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

// 版本更新
+ (void)updateVersionWithUrlStr:(NSString *)urlStr successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    
    
    NSString *url = [M_STOREVALUE(urlStr) stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager POST:url parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        
        successHandle(operation,responseObject);
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
        failureHandle(operation,error);
    }];

}

#pragma mark -- 外出单列表
/**当天外出单列表*/
+ (void)getOutListWithUserid:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/out!curDayList.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userId"] = userId;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

#pragma mark 外出签到或者签退
/**外出签到签退*/
+ (void)outSignOrSignOutWithUserId:(NSString *)userId applyid:(NSString *)applyId typeFlag:(NSString *)typeFlag address:(NSString *)address longitude:(NSString *)longitude latitude:(NSString *)latitude successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/out!sign.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userId"] = userId;
    dictM[@"applyId"] = applyId;
    dictM[@"address"] = address;
    dictM[@"longitude"] = longitude;
    dictM[@"latitude"] = latitude;
    dictM[@"typeFlag"] = typeFlag;
    
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

#pragma mark 外出单流程办理

+ (void)outSignOrSignOutWithProcedureParameters:(NSDictionary *)parameters successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/out!sign.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}


#pragma mark -- 签到统计
/**签到统计*/
+ (void)getOutSignListWithUserId:(NSString *)userId staticDate:(NSString *)staticDate orderFlag:(NSString *)orderFlag successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/out!signList.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userId"] = userId;
    dictM[@"staticdate"] = staticDate;
    dictM[@"orderFlag"] = orderFlag;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}
/**当天手机考勤列表*/
#pragma mark 当天手机考勤列表
+ (void)getMobileCurdaySignListWithUserId:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/mobileAttendance!curDayList.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userId"] = userId;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

/**外出手机签到签退*/
#pragma mark 外出手机签到或者签退
+ (void)OutMobileSignOrSignOutWithUserId:(NSString *)userId signFlag:(NSString *)signFlag address:(NSString *)address successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/mobileAttendance!outSign.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userId"] = userId;
    dictM[@"signFlag"] = signFlag;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];
}



#pragma mark 手机外出打卡流程办理中

+ (void)OutMobileSignOrSignOutProcedureWithParameters:(NSDictionary *)parameters successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/mobileAttendance!outSign.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];
}



/**公司内手机考勤*/
#pragma mark 公司内部手机签到或者签退
+ (void)mobileSignOrSignOutWithUserId:(NSString *)userId signFlag:(NSString *)signFlag address:(NSString *)address successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/mobileAttendance!internalSign.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userId"] = userId;
    dictM[@"signFlag"] = signFlag;
    dictM[@"address"] = address;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

/**验证内网是否同*/
#pragma mark 验证内网
+ (void)checkInlineIsAvalibleWithsuccessHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/mobileAttendance!check.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

/**获取当前系统时间*/
#pragma mark -- 获取服务器时间
+ (void)getServerTimeWithsuccessHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/mobileAttendance!getCurTime.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];
}

/**验证手机是否认证*/
#pragma mark 验证手机认证
+ (void)checkMobileWithUserId:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/user!mobileCheckCertificate.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userId"] = userId;

    NSString *bundleID = [NSBundle mainBundle].bundleIdentifier;
//    [SSKeychain deletePasswordForService:bundleID account:@"DeviceUUID"];
    NSString *uuid = [SSKeychain passwordForService:bundleID account:@"DeviceUUID"];
    dictM[@"mobileUuid"] = uuid;
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

/**手机认证*/
#pragma mark 手机认证接口
+ (void)certifyMobileWithUserId:(NSString *)userId phone:(NSString *)phone simUuid:(NSString *)simUuid mobileUuid:(NSString *)mobileUuid successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/user!mobileCertify.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"userId"] = userId;
//    dictM[@"phone"] = phone;
//    dictM[@"simUuid"] = simUuid;
    dictM[@"mobileUuid"] = mobileUuid;
    NSLog(@"%@",dictM);
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

#pragma mark -- 验证公司服务器
/**验证是否在公司*/
+ (void)checkIntraCompanyWith:(NSString *)url successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
//    NSString *urlStr = [[NSString stringWithFormat:@"%@",url] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
//    MSw0MDI4ZmI5NTU1NzY4YmE1MDE1NTc3MzUyODhkMDAxNSxPSVBQVHJqM1R2T3Q1MFYtRVZ0RG93
    
    [manager GET:url parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];
}


#pragma mark 流程申请
+ (void)workFlowApplyWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize category:(NSString *)category successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    NSString *autho = [[[NSString stringWithFormat:@"%@:%@:%@",M_STOREVALUE(loginName),M_STOREVALUE(password),M_STOREVALUE(companyId)] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"pageNo"] = pageNo;
    dictM[@"pageSize"] = pageSize;
    //当分类为空字符串时会返回左侧的分类列表以及默认的分类中的信息，当传入分类时，只返回分类中的信息
    dictM[@"category"] = M_STOREVALUE(category);
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/workflow!getWorkflowApplyJsonData.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager.requestSerializer setValue:[NSString stringWithFormat:@"Basic %@",autho] forHTTPHeaderField:@"Authorization"];
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];
}


#pragma mark 根据流程申请获取对应流程
+ (void)getWorkFlowWithApplyAndLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId FormId:(NSString *)formId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    NSString *autho = [[[NSString stringWithFormat:@"%@:%@:%@",M_STOREVALUE(loginName),M_STOREVALUE(password),M_STOREVALUE(companyId)] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"formId"] = formId;
    
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/workflow!getWorkflowsByFormId.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager.requestSerializer setValue:[NSString stringWithFormat:@"Basic %@",autho] forHTTPHeaderField:@"Authorization"];
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];
}



#pragma mark 已申请流程
+ (void)yiShengQingLiuChengWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize category:(NSString *)category successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    
    
    NSString *autho = [[[NSString stringWithFormat:@"%@:%@:%@",M_STOREVALUE(loginName),M_STOREVALUE(password),M_STOREVALUE(companyId)] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];

    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"pageNo"] = pageNo;
    dictM[@"pageSize"] = pageSize;
    //当分类为空字符串时会返回左侧的分类列表以及默认的分类中的信息，当传入分类时，只返回分类中的信息
    dictM[@"category"] = M_STOREVALUE(category);
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/workflow!getWorkflowApplyDoneJsonData.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager.requestSerializer setValue:[NSString stringWithFormat:@"Basic %@",autho] forHTTPHeaderField:@"Authorization"];
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

#pragma mark 待办流程
+ (void)daiBanLiuChengWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize category:(NSString *)category successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    
    NSString *autho = [[[NSString stringWithFormat:@"%@:%@:%@",M_STOREVALUE(loginName),M_STOREVALUE(password),M_STOREVALUE(companyId)] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];
    
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"pageNo"] = pageNo;
    dictM[@"pageSize"] = pageSize;
    //当分类为空字符串时会返回左侧的分类列表以及默认的分类中的信息，当传入分类时，只返回分类中的信息
    dictM[@"category"] = M_STOREVALUE(category);
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/workflow!getWorkflowDealJsonData.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager.requestSerializer setValue:[NSString stringWithFormat:@"Basic %@",autho] forHTTPHeaderField:@"Authorization"];
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}
#pragma mark 已办流程
+ (void)yiBanLiuChengWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize category:(NSString *)category successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    
    
    NSString *autho = [[[NSString stringWithFormat:@"%@:%@:%@",M_STOREVALUE(loginName),M_STOREVALUE(password),M_STOREVALUE(companyId)] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];
   
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"pageNo"] = pageNo;
    dictM[@"pageSize"] = pageSize;
    //当分类为空字符串时会返回左侧的分类列表以及默认的分类中的信息，当传入分类时，只返回分类中的信息
    dictM[@"category"] = M_STOREVALUE(category);
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/workflow!getWorkflowDoneJsonData.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager.requestSerializer setValue:[NSString stringWithFormat:@"Basic %@",autho] forHTTPHeaderField:@"Authorization"];
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

#pragma mark 草稿箱
+ (void)caoGaoXiangWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize category:(NSString *)category successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    
    
    NSString *autho = [[[NSString stringWithFormat:@"%@:%@:%@",M_STOREVALUE(loginName),M_STOREVALUE(password),M_STOREVALUE(companyId)] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    dictM[@"pageNo"] = pageNo;
    dictM[@"pageSize"] = pageSize;
    //当分类为空字符串时会返回左侧的分类列表以及默认的分类中的信息，当传入分类时，只返回分类中的信息
    dictM[@"category"] = M_STOREVALUE(category);
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/workflow!getWorkflowDraftJsonData.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager.requestSerializer setValue:[NSString stringWithFormat:@"Basic %@",autho] forHTTPHeaderField:@"Authorization"];
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

#pragma mark 流程日志
+ (void)liuChengRiZhiWithcaoGaoXiangWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId processInstanceId:(NSString *)processInstanceId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    
    NSString *autho = [[[NSString stringWithFormat:@"%@:%@:%@", M_STOREVALUE(loginName),M_STOREVALUE(password),M_STOREVALUE(companyId)] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    
    //当分类为空字符串时会返回左侧的分类列表以及默认的分类中的信息，当传入分类时，只返回分类中的信息
    dictM[@"processInstanceId"] = M_STOREVALUE(processInstanceId);
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/workflow!getWorkflowLogsJsonData.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager.requestSerializer setValue:[NSString stringWithFormat:@"Basic %@",autho] forHTTPHeaderField:@"Authorization"];
    [manager POST:urlStr parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}

/**删除草稿箱*/

+ (void)delDraftWithUrlStr:(NSString *)urlStr draftId:(NSString *)draftId loginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    
    
    NSString *autho = [[[NSString stringWithFormat:@"%@:%@:%@",M_STOREVALUE(loginName),M_STOREVALUE(password),M_STOREVALUE(companyId)] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];
    NSMutableDictionary *dictM = [NSMutableDictionary dictionary];
    
    //当分类为空字符串时会返回左侧的分类列表以及默认的分类中的信息，当传入分类时，只返回分类中的信息
    dictM[@"id"] = M_STOREVALUE(draftId);
    NSString *url = [[NSString stringWithFormat:@"http://%@/OA_CBD%@",SERVERIP,urlStr] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager.requestSerializer setValue:[NSString stringWithFormat:@"Basic %@",autho] forHTTPHeaderField:@"Authorization"];
    [manager POST:url parameters:dictM success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}


/**获取意见反馈可选列表*/
+ (void)getSuggestCategoryWithSuccessHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSString *urlStr = [[NSString stringWithFormat:@"http://%@/OA_CBD/appInterface/opinion!appModelList.action",SERVERIP] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager POST:urlStr parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        successHandle(operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failureHandle(operation,error);
    }];

}
@end
